<template>
    <div class="asider">
        <el-scrollbar wrap-class="scrollbar-wrapper">
            <el-menu
                default-active="2"
                class="el-menu-vertical-demo"
                background-color="#304156"
                text-color="#bfcbd9"
                :unique-opened="false"
                active-text-color="#409EFF"
                :collapse-transition="false"
                mode="vertical"
            >
                <el-submenu index="1">
                    <template slot="title">
                        <i class="el-icon-location"></i>
                        <span>导航一</span>
                    </template>
                    <el-menu-item-group>
                        <el-menu-item index="1-1">选项1</el-menu-item>
                        <el-menu-item index="1-2">选项2</el-menu-item>
                    </el-menu-item-group>
                    <el-menu-item index="1-3">选项3</el-menu-item>
                    <el-submenu index="1-4">
                        <template slot="title">选项4</template>
                        <el-menu-item index="1-4-1">选项1</el-menu-item>
                    </el-submenu>
                </el-submenu>
                <el-menu-item index="2">
                    <i class="el-icon-menu"></i>
                    <span slot="title">导航二</span>
                </el-menu-item>
                <el-menu-item index="3" disabled>
                    <i class="el-icon-document"></i>
                    <span slot="title">导航三</span>
                </el-menu-item>
                <el-menu-item index="4">
                    <i class="el-icon-setting"></i>
                    <span slot="title">导航四</span>
                </el-menu-item>
            </el-menu>
        </el-scrollbar>
    </div>
</template>

<script>
export default {
    name: "asider",
    methods: {
        handleOpen(key, keyPath) {
            console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
            console.log(key, keyPath);
        },
    },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
.asider {
    min-height: 100vh;
    background: #304156;
}
.el-menu {
    border: none;
    // 修改子菜单的背景色
    // .el-menu-item {
    //     background-color: #1f2d3d !important;
    // }
    // // 鼠标悬浮时，子菜单的样式：
    // .el-menu-item:hover {
    //     outline: 0 !important;
    //     background: rgb(39, 52, 69) !important;
    // }

    // // 鼠标悬浮时，主菜单的样式：
    // // .el-submenu__title:focus,
    // .el-submenu__title:hover {
    //     outline: 0 !important;
    //     // color: #409eff !important;
    //     // background: none !important;
    //     background: rgb(39, 52, 69) !important;
    // }
}
</style>
